<extend name="Public/base"/>
<block name="body">
    <div class="reg">
        <form action="{:U('User/editUser')}" method="post">
            <input name="field" type="hidden" value="{$field}" />
            <div class="weixinBody">
                <if condition="$field eq 'gender'">
                    <div class="weixinBodybox sjyhm">
                        <div class="xgline" style="overflow:visible;">
                            <span class="xgicon">性别</span>
                            <!--<select name="gender" style="height:98px; width:70%; border:transparent; border:0;">-->
                                <!--<option <eq name="gender" value="1">selected</eq> value="1">男</option>-->
                                <!--<option <eq name="gender" value="0">selected</eq> value="0">女</option>-->
                            <!--</select>-->
                            <div style="float:left; width:70%; height:98px; position:relative;">
                                <input name="gender" type="hidden" value='{$gender}'/>
                                <h4 style=" cursor:pointer;" onclick="selectBtn(this);">
                                    <b style="float:left; line-height:98px;font-size:20px; font-weight:normal;"><eq name='gender' value="1">男</eq> <eq name='gender' value="0">女</eq></b>
                                    <i style="display:block; float:right; width:0; height:0; border-top:#ccc 12px solid; margin-top:43px; border-left:transparent 8px solid; border-right:transparent 8px solid;"></i>
                                    <div style="clear:both;"></div>
                                </h4>
                                <div style="display:none;">
                                    <p style="cursor:pointer; line-height:60px; font-size:20px; width:100%;position: absolute; background:#f5f5f5; left:0; top:98px; border:#e5e5e5 1px solid; text-indent:20px;" id="option1" onclick="getOptionValue(this);">男</p>
                                    <p style="cursor:pointer;line-height:60px; font-size:20px; width:100%;position: absolute; background:#f5f5f5; left:0; top:158px; border:#e5e5e5 1px solid; text-indent:20px;" id="option0" onclick="getOptionValue(this);">女</p>
                                </div>
                            </div>
                            <div style="clear:both;"></div>
                        </div>
                    </div>
                <elseif condition="$field eq 'company'"/>
                    <div class="weixinBodybox renderClass">
                        <div class="xgline">
                            <span class="xgicon">公司</span>
                                <input type="text" name="company"
                                    <input type="text" name="self_description"
                                    <empty name='self_description'> placeholder='请输入贵公司的名称' <else />
                                        value='{$company}'
                                    </empty>
                                >
                        </div>
                    </div>
                <elseif condition="$field eq 'self_description'"/>
                    <div class="weixinBodybox renderClass">
                        <div class="xgline">
                            <span class="xgicon">个性签名</span>
                                <input type="text" name="self_description"
                                    <empty name='self_description'> placeholder='请输入您的个性签名' <else />
                                        value='{$self_description}'
                                    </empty>
                                >
                        </div>
                    </div>
                </if>
            </div>
            <div class="xgfoot">
                <div class="submitBtn">
                    <input type="submit" value="修改">
                </div>
            </div>
        </form>
    </div>
    <script>
        function selectBtn(dq){
            var _this = $(dq);
            _this.siblings('div').show();
        }
        function getOptionValue(dq){
            var _this = $(dq);
            var optionValue;
            if(_this.attr('id') == 'option1'){
                optionValue = 1;
                _this.parent().siblings('h4').find('b').text('男');
            }else{
                optionValue = 0;
                _this.parent().siblings('h4').find('b').text('女');
            }
            _this.parent().siblings('input').val(optionValue);
            _this.parent().hide();
//            alert(_this.parent().siblings('h4').find('b').text());
        }
    </script>
</block>
